Repository navigation
Addresses comments from #623 in ActiveRolesProvider - #708
collado-mike wants to merge 1 commit into
Conversation
| public SecurityContext createSecurityContext( | ||
| SecurityContext ctx, AuthenticatedPolarisPrincipal principal) { | ||
| Set<String> validRoleNames = activeRolesProvider.getActiveRoles(principal); | ||
| if (validRoleNames.isEmpty()) { |
There was a problem hiding this comment.
This is making the tests fail, and I think we do have a problem. DefaultActiveRolesProvider expects the principal to have the role PRINCIPAL_ROLE_ALL when all roles are activated:
boolean allRoles = tokenRoles.contains(BasePolarisAuthenticator.PRINCIPAL_ROLE_ALL);But BasePolarisAuhtenticator creates a principal with an empty roles set in that case. You need to change BasePolarisAuthenticator.getPrincipal():
if (tokenInfo.getScope() != null) {
if (tokenInfo.getScope().equals(PRINCIPAL_ROLE_ALL)) {
activatedPrincipalRoles.add(PRINCIPAL_ROLE_ALL); // this is missing
} else {
activatedPrincipalRoles.addAll(...);
}
}|
@collado-mike if you want to rebase this PR, the two filters were moved/renamed to:
Both are in |
|
This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
Addresses comments from #623